package com.example.liuxing.jdmall.adpater;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.List;

/**
 * Created by liuxing on 2017/8/1.
 */

public class JDBaseAdpater<T> extends BaseAdapter {

    protected List<T> mdatas;
    protected Context mContext;
    protected LayoutInflater mInflater;

    public JDBaseAdpater(Context context) {
        mContext = context;
        mInflater = LayoutInflater.from(mContext);
    }

    // 设置数据
    public void setDatas(List<T> datas) {
        mdatas = datas;
    }

    // BaseAdapter
    @Override
    public int getCount() {
        return mdatas != null? mdatas.size(): 0;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        return null;
    }
}
